package com.minimalist.common.entity.lindi.vo.provinceindex;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标平台_省级林地指标实体")
public class LindiProvinceIndexVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "省级指标ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "provinceIndexId", description = "省级指标ID", type = "string")
    private Long provinceIndexId;

    @Schema(name = "provinceQuantity", description = "省级公益林指标亩数", type = "string")
    private String provinceQuantity;

    @Schema(name = "tradeQuantity", description = "省级公益林指标交易量", type = "string")
    private String tradeQuantity;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public LindiProvinceIndexVO(){
    }

    public Long getProvinceIndexId(){
        return provinceIndexId;
    }

    public void setProvinceIndexId(Long provinceIndexId){
        this.provinceIndexId = provinceIndexId;
    }

    public String getProvinceQuantity(){
        return provinceQuantity;
    }

    public void setProvinceQuantity(String provinceQuantity){
        this.provinceQuantity = provinceQuantity;
    }

    public String getTradeQuantity(){
        return tradeQuantity;
    }

    public void setTradeQuantity(String tradeQuantity){
        this.tradeQuantity = tradeQuantity;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiProvinceIndexVO that = (LindiProvinceIndexVO) o;
        return Objects.equals(provinceIndexId, that.provinceIndexId) && Objects.equals(provinceQuantity, that.provinceQuantity) && Objects.equals(tradeQuantity, that.tradeQuantity) && Objects.equals(createId, that.createId) && Objects.equals(updateId, that.updateId) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(provinceIndexId, provinceQuantity, tradeQuantity, createId, updateId, createTime, updateTime);
    }
}